home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1471 / clsfiles.cls < prev    next >
Encoding:
Text File  |  1997-02-11  |  1.1 KB  |  52 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "clsFileSysItem"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Private pChildren As clscFileSysItems
  11. Public strDirPath As String
  12. Public Name As String
  13. Public Size As Long
  14. Public DateModified As Date
  15. Public Image As Variant 'required. Index or key of an icon in an imagelist
  16. Public HasChildren As Boolean 'required. ThreadView needs this to know whether draw plus/minus
  17. Public Parent As clscFileSysItems
  18.  
  19. 'Requred  function
  20. Public Function Properties(value)
  21.  
  22. Select Case value
  23.     Case "Name"
  24.         Properties = Name
  25.     Case "Size"
  26.         Properties = Format(Size, "Standard")
  27.     Case "DateModified"
  28.         Properties = DateModified
  29.     Case Else
  30.         'Trap your own typing mistakes
  31.         Properties = "#Error#"
  32. End Select
  33.  
  34. End Function
  35.  
  36. Private Sub Class_Initialize()
  37. Image = "Folder"
  38.  
  39. End Sub
  40.  
  41. Public Property Get Children()
  42.  
  43. If pChildren Is Nothing Then
  44.     Set pChildren = New clscFileSysItems
  45.     pChildren.Create strDirPath & Name & "\"
  46. End If
  47.  
  48. Set Children = pChildren
  49.  
  50. End Property
  51.  
  52.